<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/vue.js"></script>
    <script src="../js/axios.js"></script>
    <script src="../js/util.js"></script>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="shortcut icon" href="../favicon.ico">
    <link href="../../css/bootstrap.min-lumen.css" rel="stylesheet">
    <link href="../../css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="../../css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
    <link href="../../css/animate.css" rel="stylesheet">
    <link href="../../css/style.css?v=4.1.0" rel="stylesheet">
    <link href="../../css/plugins/pageMe/pageMe.css" rel="stylesheet"/>
    <link href="../../css/plugins/progressbar/mprogress.css" rel="stylesheet"/>
    <link href="../../css/plugins/progressbar/style.css" rel="stylesheet"/>
</head>
<body>
<!--<a href="add.html">添加</a>-->
<div id="a">
    <!-- <table border="1" cellspacing="0">
         <tr>
             <td>编号</td>
             <td>姓名</td>
             <td>操作</td>
         </tr>
         <tr v-for="item in page.list">
             <td>{{item.id}}</td>
             <td>{{item.name}}</td>
             <td>
                 <a :href="'edit.html?id='+item.id">修改</a>
                 <a @click="del(item.id)">删除</a>
             </td>
         </tr>
     </table>-->
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>学生表管理模块</h5>
            </div>
            <div class="ibox-content">
                <div class="row row-lg">
                    <div class="clearfix hidden-xs"></div>
                    <div class="col-sm-12">
                        <!-- Example Checkbox Select -->
                        <div class="example-wrap">

                            <!-- 查询区域 -->
                            <div id="queryModel" tagId="queryTag">
                                <input type="text" v-model="serachMap.sname" placeholder="学生名称"
                                       style="margin-top: 10px"/>&nbsp;&nbsp;
                                <button type="button" class="btn btn-primary btn-sm" @click="findPage(1)">查询</button>&nbsp;
                                <button type="button" class="btn btn-primary btn-sm" @click="exportXx()">导出excel
                                </button>
                                <button type="button" class="btn btn-primary btn-sm" @click="t1()">学生统计</button>
                            </div>
                            <!-- 查询区域 end-->

                            <!-- 添加数据区域 -->
                            <div style="text-align: right; margin: 8px">
                                <button tagId="addTag" type="button" class="btn btn-success btn-sm" @click="t()"
                                        style="margin: 8px">
                                    添加数据
                                </button>
                            </div>

                            <!-- 查询结果表格显示区域 -->
                            <div id="newsContent" class="table-responsive" style="overflow: scroll;" v-cloak>
                                <table class="table table-hover table-bordered text-nowrap">
                                    <tr>
                                        <td>操作</td>
                                        <td>学生编号</td>
                                        <td>学生姓名</td>
                                        <td>学生地址</td>
                                        <td>学生年龄</td>
                                    </tr>
                                    <tbody id="dataTable">
                                    <tr v-for="data in page.list">
                                        <td>
                                                <span tagId="upTag"><a :href="'editStu.html?id='+data.id"
                                                                       class="btn btn-info btn-sm">
                                                    更新
                                                </a>&nbsp;</span>
                                            <span tagId="delTag"><button type="button" class="btn btn-danger btn-sm"
                                                                         @click="del(data.id)">
                                                    删除
                                                </button>&nbsp;</span>
                                        </td>
                                        <td>{{data.id}}</td>
                                        <td>{{data.sname}}</td>
                                        <td>{{data.saddress}}</td>
                                        <td>{{data.age}}</td>
                                    </tr>
                                    </tbody>
                                </table>
                                <div id="pageID" class="page_div"></div>
                            </div>
                            <!-- 查询结果表格显示区域 end-->
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;第&nbsp;{{page.pageNum}}&nbsp;页&nbsp;共&nbsp;{{page.lastPage}}&nbsp;页&nbsp;共&nbsp;{{page.total}}&nbsp;条
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input class="btn btn-info btn-group-sm" value="首页" type="button" @click="findPage(1)">
    <input class="btn btn-info btn-group-sm" v-if="page.pageNum!=1" value="上一页" @click="findPage(page.prePage)"
           type="button">
    <button class="btn btn-info btn-group-sm" v-for="p in page.navigatepageNums" @click="findPage(p)">{{p}}</button>
    <input class="btn btn-info btn-group-sm" v-if="page.pageNum!=page.lastPage" value="下一页"
           @click="findPage(page.nextPage)" type="button">
    <input class="btn btn-info btn-group-sm" value="尾页" @click="findPage(page.lastPage)" type="button">
</div>
<script>
    new Vue({
        el: "#a",
        data: {
            page: {},
            serachMap: {}
        },
        created() {
            this.findPage(1)
        },
        methods: {
            t1() {
                location.href = "studentStatistics.html"
            },
            t() {
                location.href = "addStu.html"
            },
            findPage(pageIndex) {
                axios.post("/sys/stu/findPages?pageIndex=" + pageIndex, this.serachMap).then(res => {
                    this.page = res.data.data
                })
            }
            /*del(id) {
                if (confirm("确定删除吗")) {
                    axios.get("/sys/xx/del?id=" + id).then(res => {
                        location.reload()
                        alert("删除成功!")
                    })
                }
            }*/
        }
    })
</script>
</body>
</html>